#include<cstdio>
#include<cstring>
const double MAXINT=210000000;
const double sq=141.4213562373095; 
double f[2][1001];
bool b[1001][1001];
int n,m,t;
double min(double x,double y)
{
       return x<y?x:y;
}
int main()
{
    freopen("test.in","r",stdin);
    freopen("test.out","w",stdout);
    scanf("%d%d%d",&m,&n,&t);
    memset(b,0,sizeof(b));
    for(int i=1;i<=t;i++)
    {
            int x,y;
            scanf("%d%d",&x,&y);
            b[y][x]=true;
    }
    f[0][0]=0;
    for(int i=1;i<=m;i++)
            f[0][i]=f[0][i-1]+100.0;
   // for(int i=1;i<=n;i++)
    //        f[i][0]=f[i-1][0]+100;
    int i=1;
    for(i=1;i<=n;i++)
    {
       f[i%2][0]=f[(i-1)%2][0]+100.0;              
       for(int j=1;j<=m;j++)
       {       
            f[i%2][j]=MAXINT;
            f[i%2][j]=min(f[i%2][j-1],f[(i-1)%2][j])+100.0;     
            if(b[i][j])f[i%2][j]=min(f[i%2][j],f[(i-1)%2][j-1]+sq);
       }
       }
 /*   for(int i=0;i<=n;i++)
    {
            for(int j=0;j<=m;j++)
            printf("%f ",f[i][j]);
    printf("\n");}*/
    printf("%0.0f\n",f[n%2][m]);
    return 0;
}
    
